import request from '@/utils/request';
import {ElMessage} from 'element-plus'


/**
 * 查询顶部
 * @returns {Promise<any>}
 */
export async function selectNavList(IdentityKey) {
    const res = await request.get('/site/cms/nav/item/list/' + IdentityKey);
    if (res.data.code === 200) {
        return res.data;
    }
    return Promise.reject(ElMessage.error(res.data.msg));
}

/**
 * 获取文章列表
 * @param typeId
 * @returns {Promise<any>}
 */
// export async function selectArticleList(typeId) {
//     const res = await request.get('/site/cms/nav/item/list/' + IdentityKey);
//     if (res.data.code === 200) {
//         return res.data;
//     }
//     return Promise.reject(ElMessage.error(res.data.msg));
// }




export async function selectConfig(key) {
    const res = await request.get('/site/cms/article/list/' + key);
    if (res.data.code === 200) {
        return res.data;
    }
    return Promise.reject(ElMessage.error(res.data.msg));
}

